package com.cx.mapper;

import com.cx.entity.Book;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface BookMapper {
    @Select("select * from book")
    List<Book> selectAllBook();

    @Select("select * from book where bookId = #{bookId}")
    Book selectBookById(int bookId);

    @Delete("delete from book where bookId = #{bookId}")
    int deleteDept(int bookId);

    @Update("update book set bookName = #{bookName} where bookId=#{bookId}")
    int updateDept(Book book);

    @Insert("insert into book(bookId, bookName, bookAuthor, price) values (#{bookId},#{bookName},#{bookAuthor},#{price})")
    int insertDept(Book book);
}
